package com.ruijiang.mapper.TaskServiceMapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruijiang.dto.count.VMTaskCountDto;
import com.ruijiang.dto.count.UserWorkCountDto;
import com.ruijiang.dto.page.PageTaskDto;
import com.ruijiang.entity.Task;
import com.ruijiang.vo.task.TaskPageVO;
import com.ruijiang.vo.task.UserWorkCountVO;
import com.ruijiang.vo.user.UserTaskCountVO;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

public interface TaskMapper extends BaseMapper<Task> {



    List<TaskPageVO> getPageList(PageTaskDto dto);



    @Select(" SELECT COUNT(*) FROM tb_task")
    Integer getTotalCount();

    @MapKey("id")
    List<Map<String, String>> getTaskReportInfo(String start, String end);

    @Select(" SELECT COUNT(*) FROM (select count(*) from tb_task group by user_id) as t1")
    Integer getUserTotal();

    List<UserWorkCountVO> getUserWorkTop10(String start, String end, Boolean isRepair, String regionId);

    UserTaskCountVO getUserWork(UserWorkCountDto dto);

    String getTaskCode(String taskCodePre);

    Integer getVMTaskCount(String innerCode, String start, String end, VMTaskCountDto dto, Integer taskStatus, Integer type);
}
